package com.summer.framework.common.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @auther: 杨杰
 * @date: 2019/5/15 18:29
 * @description:
 */
public class RegexUtils {

    public static Matcher getMatcher(String str, String regex, Integer mode) {
        Pattern pattern = null;
        if (null != mode) {
            pattern = Pattern.compile(regex, mode);
        } else {
            pattern = Pattern.compile(regex);
        }
        if (null != pattern)
            return pattern.matcher(str);
        else
            return null;
    }
}
